package com.bocloud.cmp.dao;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.resource.ResourceEvent;
import com.bocloud.common.model.Param;

/**
 * 资源事件DAO接口
 * 
 * @author dongkai
 *
 */
public interface ResourceEventDao {

	/**
	 * 分页查询
	 * 
	 * @param page
	 * @param rows
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<ResourceEvent> list(int page, int rows, List<Param> params, Map<String, String> sorter)
			throws Exception;

	/**
	 * 数量
	 * 
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int count(List<Param> params) throws Exception;

	/**
	 * 保存
	 * 
	 * @param resourceEvent
	 * @return
	 * @throws Exception
	 */
	public ResourceEvent save(ResourceEvent resourceEvent) throws Exception;

	/**
	 * 根据ID查询
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public ResourceEvent query(Long id) throws Exception;

	/**
	 * 更新
	 * 
	 * @param resourceEvent
	 */
	public void update(ResourceEvent resourceEvent) throws Exception;

	/**
	 * 根据vmId查询
	 * 
	 * @param vmId
	 * @return
	 */
	public ResourceEvent queryByVmId(Long vmId) throws Exception;
}
